package com.jsnkj.basic.photo

import android.net.Uri
import androidx.databinding.ViewDataBinding
import androidx.lifecycle.ViewModel
import com.jsnkj.basic.bean.PhotoBean
import com.jsnkj.basic.mvvm.BaseMVVMFragment

abstract class BaseMVVMPhotoFragment<VDB: ViewDataBinding, VM: ViewModel> : BaseMVVMFragment<VDB, VM>() {

    protected var photoSelectedListener: ((Uri) -> Unit)? = null// 选中照片回调

    abstract fun loadPhoto(demoList: ArrayList<PhotoBean>)

    fun setOnPhotoSelectedListener(listener: ((Uri) -> Unit)) {
        photoSelectedListener = listener
    }

    protected var multiPhotoSelectedListener: ((LinkedHashMap<Int , PhotoBean>) -> Unit)? = null

    fun setOnMultiPhotoSelectedListener(listener: ((LinkedHashMap<Int , PhotoBean>) -> Unit)){
        multiPhotoSelectedListener = listener
    }
}